﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using OpenFlashChart;
using System.Collections.Generic;
using System.Text; 

public partial class RotateShowScores : System.Web.UI.Page
{
    public string URL = string.Empty;
    public string URL2 = string.Empty;
    public string URL3 = string.Empty;
    public string URL4 = string.Empty;
    public string TIMER = "10000";
    public string sPlayer = string.Empty;
    public string ListOfPlayers = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            //Obtenemos los torneos en los que juega
            //List<Tournament> lTournament = Tournament.getAvailableTournaments();  
            if (Request.QueryString["id"] != null)
            {
                Player oPlayer = Player.GetPlayerByNumber(int.Parse(Request.QueryString["id"]));//; new Player(int.Parse(Request.QueryString["id"]));
                sPlayer = oPlayer.Player_Nick + " (#" + oPlayer.Player_Number.ToString() + ")";
                //ID PLAYER|TIPO GRAFICO|ID TORNEO
                URL = "data.aspx?id=" + Request.QueryString["id"] + "|1|1";
                URL2 = "data.aspx?id=" + Request.QueryString["id"] + "|2|1";
                URL3 = "data.aspx?id=" + Request.QueryString["id"] + "|1|2";
                URL4 = "data.aspx?id=" + Request.QueryString["id"] + "|2|2"; ;
                Configuration rootWebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
                TIMER = rootWebConfig.AppSettings.Settings["milisecondsToShowProfile"].Value;
            }
            else {
                List<Player> oPlayer= Player.GetPlayersByTournament(1);
                foreach (Player IPlayer in oPlayer) {
                    ListOfPlayers += IPlayer.Player_Number.ToString() + ",";
                }
                ListOfPlayers = ListOfPlayers.Substring(0, ListOfPlayers.Length - 1);
                Session["ListOfPlayersRound"] = ListOfPlayers;
            }
            
        }
        catch (Exception) { 
        
        }  
    }
}
